#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
void F(int* a)
{
	a[0] = 1;
	a[1] = 1;
	for (int i = 2; i < 35; i++)
	{
		a[i] = a[i - 1] + a[i - 2];
	}
}
int prime(int n)
{
	int f[35] = { 0 };
	F(f);
	for (int i = 0; i < 35; i++)
	{
		if (n == f[i])
			return i + 1;
	}
	return -1;
}
int main()
{
	int n = 0;
	scanf("%d", &n);
	int a = 0;
	a = prime(n);
	printf("%d\n", a);
	return 0;
}